<template>
	<view class="userContainer">
		
		<img class="loginbg" src="../../static/loginbg.jpg" alt="">
		
		<van-button class="toIndexBtn" plain type="primary"  to="/pages/index/index">立即体验</van-button>
		
		<view class="loginroBtn">
			<van-button v-if="flag" :loading="loading" type="primary" round="true" loading-text="加载中..."  @click="hanldeChange">二维码登录</van-button>
			<van-button v-else :loading="loading" type="primary" round="true" loading-text="加载中..."  @click="hanldeChange">账号密码登录</van-button>
		</view>
		
		<view class="loginBox">
			<!-- 账号登录组件 -->
			<uni-userLogin v-if="flag"></uni-userLogin>
			<!-- 二维码登录组件 -->
			<uni-userQrLogin v-else></uni-userQrLogin>
		</view>
		
		
		
		
	</view>
</template>

<script setup>
import { ref } from 'vue';

let flag = ref(true)		// 

let loading = ref(false)	// 加载状态


const hanldeChange = () => {
	loading.value = true
	setTimeout(()=>{
		loading.value = false
		flag.value = !flag.value
	},500)
}

</script>

<style scoped>
@import url('user.scss');
</style>
